package com.gton.person.controller;


import com.gton.person.commons.ResultAdvice;
import com.gton.person.service.StudentUserInfoService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author gton
 * @since 2020-11-25
 */
@RestController
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentUserInfoService studentUserInfoService;

    /**
     * 获取用户表ID
     */
    @RequestMapping(value = "/getUserInfoId", method = RequestMethod.GET)
    public ResultAdvice GetUserInfoId(@RequestParam("loginId") Integer loginId) {
        String byUserId = studentUserInfoService.getByUserId(loginId);
        return !StringUtils.isEmpty(byUserId) ? ResultAdvice.OK(byUserId) : ResultAdvice.error("未登录");
    }


}

